<script type="text/javascript">
<!--
jQuery(function() {
jQuery( "#fromdateD" ).datepicker({ maxDate: "+0d", dateFormat: "dd.mm.yy" });
jQuery( "#todateD" ).datepicker({ maxDate: "+0d", dateFormat: "dd.mm.yy" });

var selectedWeekStart;
var selectedWeekEnd;

jQuery( "#fromdateW" ).datepicker({
    firstDay:1,
    maxDate: "+0d",
    showOtherMonths:true,
    onSelect: function(dateText){
       selectedWeekStart = $.datepicker.iso8601Week(new Date(dateText));
    } ,

    //set the class 'week-highlight' for the whole week
    beforeShowDay: function(d){
        if (!selectedWeekStart) { return [true,''];}
        if (selectedWeekStart == $.datepicker.iso8601Week(d)){
              return [true,'ui-state-active'];   
        }
        return [true,''];
    }
});
jQuery( "#todateW" ).datepicker({
    firstDay:1,
    maxDate: "+0d", 
    showOtherMonths:true,
    onSelect: function(dateText){
       selectedWeekEnd = $.datepicker.iso8601Week(new Date(dateText));
    } ,

    //set the class 'week-highlight' for the whole week
    beforeShowDay: function(d){
        if (!selectedWeekEnd) { return [true,''];}
        if (selectedWeekEnd == $.datepicker.iso8601Week(d)){
              return [true,'ui-state-active'];   
        }
        return [true,''];
    }
});

jQuery( "#tabs" ).tabs({ disabled: [ 1, 2, 3 ] });
});
//-->
</script>
<h1>Analytics of {$business->getName()}</h1>
<input type="hidden" name="business" id ="business" value="{$smarty.get.b}" />
<div id="tabs" style="width:100%;">
  <ul>
    <li><a href="#tabs-1">Daily</a></li>
    <li><a href="#tabs-2">Weekly</a></li>
    <li><a href="#tabs-3">Monthly</a></li>
    <li><a href="#tabs-4">Annual</a></li>
  </ul>
  <div id="tabs-1">
    <p>
    <table style="width:100%;">
	<tr><td>{$lang['period']}</td><td align="center">{$lang['from']}: <input type="text" id="fromdateD" class="feedbackInput inputHeight"/></td><td>{$lang['to']}: <input type="text" id="todateD" class="feedbackInput inputHeight"/></td></tr>
	</table>
    </p>
  </div>
  <div id="tabs-2">
    <p>
    <table style="width:100%;">
	<tr><td>{$lang['period']}</td><td align="center">{$lang['from']}: <input type="text" id="fromdateW" class="feedbackInput inputHeight"/></td><td>{$lang['to']}: <input type="text" id="todateW" class="feedbackInput inputHeight"/></td></tr>
	</table>
    </p>
  </div>
  <div id="tabs-3">
    <p>
    <table style="width:100%;">
	<tr><td>{$lang['period']}</td><td align="center">{$lang['from']}: <input type="text" id="fromdateM" class="feedbackInput inputHeight"/></td><td>{$lang['to']}: <input type="text" id="todateM" class="feedbackInput inputHeight"/></td></tr>
	</table>
    </p>
  </div>
  <div id="tabs-4">
    <p>
    <table style="width:100%;">
	<tr><td>{$lang['period']}</td><td align="center">{$lang['from']}: <input type="text" id="fromdateA" class="feedbackInput inputHeight"/></td><td>{$lang['to']}: <input type="text" id="todateA" class="feedbackInput inputHeight"/></td></tr>
	</table>
    </p>
  </div>
</div>
<br>
<p class="readmore"><a href="#" onclick="analyticsSearch()">{$lang['search']}</a> »</p>
<div id="chartArea">
	<img src="{$smarty.const.WEBROOT}/tmp/{$business->getCode()}.png" />
</div>